<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="fr" />
	<meta name="description" content="art"/>
	<link rel="icon" type="image/ico" href="favicon.ico"/>
	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/panier.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form_inscription.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form_produit.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/boutique.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form_registration.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/livraison.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/paiement.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/profil.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/produit.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/login.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/commandes.css" media="screen" />
	
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/old/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/old/main.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>
	<div class="container" id="page">
		<div id="header" onclick="location.href='http://localhost:8888/artandco/'">
			<p><img src="images/logo.png" alt="header"/></p>
		</div><!-- header -->

		<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>Yii::app()->createUrl("rechercher/searchbycriteria"),
			'method'=>'post',
		)); ?>

		<div id="search">
			<table>
				<tr>
					<td class="search_grand_table">
						<table>
							<tr>
								<td class="search_titre">Par sa catégorie</td>
							</tr>
							<?php 
								$listCat=Layout::getListeCategorie();
								foreach ($listCat as $recupListeCat) {
									echo '<tr><td class="search_entree_texte">';
									echo CHtml::link($recupListeCat->libelle,array('rechercher/searchbycategory','categorie'=>CHtml::encode($recupListeCat->libelle)));
									echo '</td></tr>';
								}
							?>		
						</table>
					</td>
					<td class="search_grand_table">
						<table>
							<tr>
								<td class="search_titre">Par son type</td>
							</tr>
							<?php 
								$listType=Layout::getListeType();
								foreach ($listType as $recupListeType) {
									echo '<tr><td class="search_entree_texte">';
									echo CHtml::link($recupListeType->libelle,array('rechercher/searchbytype','type'=>CHtml::encode($recupListeType->libelle)));
									echo '</td></tr>';
								}
							?>		
						</table>	
					</td>
					<td class="search_grand_table">
						<table>
							<tr>
								<td class="search_titre">Par son prix</td>
							</tr>
							<?php 
								$listPrix=Layout::getCatPrix();
								foreach ($listPrix as $recupListePrix) {
									list($prixMin,$prixMax) = explode("/",Layout::getPrix($recupListePrix));
									echo '<tr><td class="search_entree_texte">';
									if ($prixMax != "") {
										echo CHtml::link($recupListePrix,array('rechercher/searchbyprice','priceI'=>CHtml::encode($prixMin),'priceS'=>CHtml::encode($prixMax)));
									}
									elseif ($prixMin >= 100){
										echo CHtml::link($recupListePrix,array('rechercher/searchbyprice','priceI'=>CHtml::encode($prixMin)));
									}
									else {
										echo CHtml::link($recupListePrix,array('rechercher/searchbyprice','priceS'=>CHtml::encode($prixMin)));
									}									
									echo '</td></tr>';
								}
							?>		
						</table>
					</td>
					<td class="search_grand_table">
						<table>
							<tr>
								<td class="search_titre" colspan="2">Par vos propres critères</td>
							</tr>
							<tr>
								<td class="search_entree_search_label">Type  :  </td>
								<td class="search_entree_search_form">
									<?php echo CHtml::dropDownList("search_entree_search_type",'',CHtml::listData(Layout::getListeType(), 'id', 'libelle'),array('empty'=>"- Type -")); ?>
								</td>
							</tr>
							<tr>
								<td class="search_entree_search_label">Catégorie   :  </td>
								<td class="search_entree_search_form">
									<?php echo CHtml::dropDownList("search_entree_search_categorie",'',CHtml::listData(Layout::getListeCategorie(), 'id', 'libelle'),array('empty'=>"- Catégorie -")); ?>
								</td>	
							</tr>
							<tr>
								<td class="search_entree_search_label">Prix   :  </td>
								<td class="search_entree_search_form">
									<select name="search_entree_search_prix" id="search_entree_search_prix">
										<option selected="selected">- Prix -</option>
										<?php
											$listPrix=Layout::getCatPrix();
											foreach ($listPrix as $recupListePrix) {
												echo "<option value='";
												list($prixMin,$prixMax) = explode("/",Layout::getPrix($recupListePrix));
												if ($prixMax != "") {
													echo CHtml::encode($prixMin).'_'.CHtml::encode($prixMax);
												}
												elseif ($prixMin >= 100){
													echo'sup_'.CHtml::encode($prixMin);
												}
												else {
													echo 'inf_'.CHtml::encode($prixMin);
												}
												echo "'>".$recupListePrix."</option>";
											}
										?>	
									</select>
								</td>
							</tr>
							<tr>
								<td class="search_entree_search_label">Auteur   :  </td>
								<td class="search_entree_search_form">
									<?php echo CHtml::dropDownList("search_entree_search_auteur",'',CHtml::listData(Layout::getListeArtiste(), 'id_client', 'client.nom'),array('empty'=>"- Artiste -")); ?>
								</td>
							</tr>
							<tr>
								<td class="search_entree_search_label">Mots clés :</td>
								<td class="search_entree_search_form" >
									<input name="search_criteria" type="text" size=22/>
								</td>
							</tr>
							<tr>
								<td class="search_entree_search_label"></td>
								<td class="search_entree_search_form" align=right >
									<?php echo CHtml::submitButton('Rechercher'); ?>
								</td>
							</tr>
						</table>
					</td>
				</tr>

			</table>
		</div>
		<?php $this->endWidget(); ?>
		
		<div id="mainmenu">
			<?php $this->widget('zii.widgets.CMenuPerso',array(
				'items'=>array(
					array('label'=>'Accueil', 'url'=>array('/site/index'), 'urlImage'=>"images/maison.png"),
					array('label'=>'La galerie', 'url'=>array('/produit/index'), 'urlImage'=>"images/boutique.png"), 
					array('label'=>'Mon panier', 'url'=>array('/panier/index'), 'urlImage'=>"images/panierMenu.png"),
					array('label'=>'Ma boutique', 'url'=>array('/artiste/boutique'), 'urlImage'=>"images/panierMenu.png", 'visible'=>!Yii::app()->user->isGuest&&isset(Client::getClientFromUser()->artiste)),
					array('label'=>Yii::app()->getModule('user')->t("Login"),'url'=>Yii::app()->getModule('user')->loginUrl, 'visible'=>Yii::app()->user->isGuest),
					array('label'=>Yii::app()->getModule('user')->t("Register"), 'url'=>Yii::app()->getModule('user')->registrationUrl, 'visible'=>Yii::app()->user->isGuest),
					array('label'=>Yii::app()->getModule('user')->t("Profile"), 'url'=>Yii::app()->getModule('user')->profileUrl, 'visible'=>!Yii::app()->user->isGuest, 'urlImage'=>"images/people.png"),
					array('label'=>Yii::app()->getModule('user')->t("Logout").' ('.Yii::app()->user->name.')', 'url'=>Yii::app()->getModule('user')->logoutUrl, 'visible'=>!Yii::app()->user->isGuest),
				),
			)); ?>
		</div><!-- mainmenu -->
		<div id="corps">
			<?php echo $content; ?>
		</div>
		<div id="partners">
			<table>
				<tr>
					<td class="partners_logo"><img src="images/part_1.jpg" alt="part_1" height="75px" width="75px"/></td>
					<td class="partners_logo"><img src="images/part_2.jpg" alt="part_2" height="75px" width="75px"/></td>
					<td class="partners_logo"><img src="images/part_3.jpg" alt="part_3" height="75px" width="75px"/></td>
					<td class="partners_logo"><img src="images/part_4.jpg" alt="part_4" height="75px" width="75px"/></td>
					<td class="partners_logo"><img src="images/part_5.jpg" alt="part_5" height="75px" width="75px"/></td>
					<td class="partners_logo"><img src="images/part_6.jpg" alt="part_6" height="75px" width="75px"/></td>
				</tr>
			</table>
		</div>
		<div id="meta">
			<table>
				<tr>
					<td class="meta_titre">Art & CO</td>
					<td class="meta_titre">Communauté</td>
					<td class="meta_titre">Recommandations</td>
					<td class="meta_titre">Partenaires</td>
					<td class="meta_titre">Remerciements</td>
				</tr>
				<tr>
					<td class="meta_entree">Qui sommes-nous ?</td>
					<td class="meta_entree">Blog & CO</td>
					<td class="meta_entree">Animaux</td>
					<td class="meta_entree">Cultura</td>
					<td class="meta_entree">Blabla</td>
				</tr>
				<tr>
					<td class="meta_entree">Découvrez notre concept</td>
					<td class="meta_entree">Facebook & CO</td>
					<td class="meta_entree">Animaux</td>
					<td class="meta_entree">Du coq à l'art</td>
					<td class="meta_entree">Blabla</td>
				</tr>
				<tr>
					<td class="meta_entree">Devenez partenaire</td>
					<td class="meta_entree">Twitter & CO</td>
					<td class="meta_entree">Animaux</td>
					<td class="meta_entree">Fnac</td>
					<td class="meta_entree">Blabla</td>
				</tr>
				<tr>
					<td class="meta_entree">Vos questions et remarques</td>
					<td class="meta_entree"></td>
					<td class="meta_entree">Animaux</td>
					<td class="meta_entree">Shop'art</td>
					<td class="meta_entree">Blabla</td>
				</tr>
				<tr>
					<td class="meta_entree">Nous contacter</td>
					<td class="meta_entree"></td>
					<td class="meta_entree">Sport</td>
					<td class="meta_entree"></td>
					<td class="meta_entree">Blabla</td>
				</tr>
			</table>
			<!-- <table>
				<td>
					<tr class="search_titre">Par sa catégorie</tr>
					<tr class="search_entree_texte">Animaux</tr>
					<tr class="search_entree_texte">Cinéma</tr>
					<tr class="search_entree_texte">Paysage</tr>
					<tr class="search_entree_texte">Sport</tr>
					<tr class="search_entree_texte">Voiture</tr>
				</td>
				<td>
					<tr class="search_titre">Par son type</tr>
					<tr class="search_entree_texte">Dessin</tr>
					<tr class="search_entree_texte">Peinture</tr>
					<tr class="search_entree_texte">Photographie</trd>
					<tr class="search_entree_texte">Poterie</tr>
					<tr class="search_entree_texte">Sculpture</tr>
				</td>
				<td>
					<tr class="search_titre">Par son prix</tr>
					<tr class="search_entree_texte">Moins de 20 euros</tr>
					<tr class="search_entree_texte">De 20 à 50 euros</tr>
					<tr class="search_entree_texte">De 50 à 100 euros</tr>
					<tr class="search_entree_texte">De 100 à 150 euros</tr>
					<tr class="search_entree_texte">Plus de 150 euros</tr>
				</td>
				<td>
					<tr class="search_titre">Par vos propres critères</tr>
					<tr class="search_entree_search_label">Type d'oeuvre</tr>
					<tr class="search_entree_search_label">Catégorie de l'oeuvre</tr>
					<tr class="search_entree_search_label">Prix de l'oeuvre</tr>
					<tr class="search_entree_search_label">Auteur de l'oeuvre</tr>
					<tr class="search_entree_search_label">&nbsp;</tr>
				</td>
				<td>
					<tr class="search_entree_search_form">
						<select name="search_entree_search_type" id="search_entree_search_type">
							<option value="indif">Indifférent</option>
							<option value="dessin">Dessin</option>
							<option value="peinture">Peinture</option>
							<option value="sculpture">Sculpture</option>
							<option value="toile">Toile</option>
						</select>
					</tr>					
					<tr class="search_entree_search_form">
						<select name="search_entree_search_categorie" id="search_entree_search_categorie">
							<option value="indif">Indifférent</option>
							<option value="dessin">Animaux</option>
							<option value="peinture">Paysage</option>
							<option value="sculpture">Sport</option>
							<option value="toile">Voiture</option>
						</select>
					</tr>
					<tr class="search_entree_search_form">
						<select name="search_entree_search_prix" id="search_entree_search_prix">
							<option value="indif">Indifférent</option>
							<option value="inf_10">Moins de 10 euros</option>
							<option value="inf_20">De 10 à 20 euros</option>
							<option value="inf_50">De 20 à 50 euros</option>
							<option value="inf_100">De 50 à 100 euros</option>
							<option value="inf_150">De 100 à 150 euros</option>
							<option value="inf_150">Plus de 150 euros</option>
						</select>
					</tr>
					<tr class="search_entree_search_form">
						<select name="search_entree_search_auteur" id="search_entree_search_auteur">
							<option value="indif">Indifférent</option>
							<option value="albert">Albert Croquis</option>
							<option value="gerard">Gérard Michelin</option>
							<option value="simon">Simon Richard</option>
						</select>
					</tr>
					<tr id="search_entree_search_button">
						<input type="button" value="Recherche"/>
					</tr>
				</td>
			</table> -->
		</div>
		<div id="footer">
			<p><img src="images/logo.png" alt="footer"/></p>
			<p>Plan du site | Conditions d'utilisation | Confidentialité | Livraison | Mentions légales | Contact</p>
		</div>
	</div><!-- page -->
</body>
</html>